verify = function(equation, msg) {
	if(typeof(equation) == 'undefined')throw msg;
	if(!equation)throw msg;
};
assert = function(msg) {
	throw msg;
};
Ext.define('UmlWebEditor.tests.Test', {
	tests: [
	],
	items: [
	],
	constructor: function(testsStore) {
		this.testsStore = testsStore;
		for(var key in this.items) {
			var tst = this.items[key];
			console.log('creating new test ' + tst + key);
			try {
				Ext.create(tst, testsStore);
			} catch(e) {
				console.log('error create ' + tst);
			}
		}
		this.test();
		return this;
	},
	test: function() {
		for(var i in this.tests) {
			var mytest = this.tests[i];
			if(typeof(mytest) == 'undefined')continue;
			console.log('tests=' + i);
			var result;
			try {
				result = mytest();
			} catch(e) {
				result = e;
			}
			var description = this.self.getName() + ': ' + '<b class="error">' + result + '</b>';
			if(typeof(result) == 'undefined') {
				description = '';
				result = '+';
			} else {
				result = '-';				
			}
			this.testsStore.add({
				name: i,
				result: result,
				description: description
			});
		}
	}
});
